CREATE PROCEDURE coreCmsUpdateVersion
(
	@cid				int,
	@NodeTitle			nvarchar(500),
	@HasEmbargoStart	bit,
	@PublishStartDT		datetime,
	@HasEmbargoEnd		bit,
	@PublishUntilDT		datetime,
	@ExpiryActionID		int,
	@ExpiryActionDataID	int,
	@XMLData			xml
)
AS
BEGIN
	SET NOCOUNT ON;

	/* Declarations */
	DECLARE		@versionID	int;
	
	/* Get the version record id */
	SELECT @versionID = ISNULL(FK_VersionV, -1) FROM Content WHERE PK_ID=@cid;
	
	/* UPDATE THE RECORDS */
	UPDATE Content SET 
		NodeTitle			= @NodeTitle,
		HasEmbargoStart		= @HasEmbargoStart,
		PublishStartDT		= @PublishStartDT,
		HasEmbargoEnd		= @HasEmbargoEnd,
		PublishUntilDT		= @PublishUntilDT,
		ExpiryActionID		= @ExpiryActionID,
		ExpiryActionDataID	= @ExpiryActionDataID
	WHERE PK_ID=@cid;
	
	
	UPDATE ContentV SET XMLData=@XMLData WHERE PK_ID=@versionID;

	SET NOCOUNT OFF;	
END